package com.enzoism.ai.config;

import jakarta.annotation.Resource;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Chat client configuration class
 *
 * @author houyunfei
 */
@Configuration
public class ChatConfig {


    @Resource(name = "openAiChatModel")
    private ChatModel openAiChatModel;

    @Bean("openAiChatClient")
    public ChatClient chatClient() {
        return ChatClient.create(openAiChatModel);
    }
}